package 代理模式;

import java.util.Date;

//代理类
public class LoggerProxy extends AbstractSubject {
    private BussinessClass bussinessObj=new BussinessClass();
    @Override
    public void method() {
        try {
            //方法调用前
            System.out.println("方法method()被调用"+new Date());
            bussinessObj.method();
            System.out.println("方法method()调用成功");
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("方法method()调用失败");
        }
    }
}
